﻿@{
    ViewBag.Title = "后台管理中心";
    Layout = "~/Areas/Admin/Views/Shared/_Layout2.cshtml";
}
@model DTcms.Model.manager
<!-- 头部 -->
<div class="layui-header">
    <div class="layui-logo">
        <img src="/admin/skin/default/logo.png" />
        <cite>DTcms后台管理</cite>
    </div>
    <ul class="layui-nav layui-layout-left" id="main-nav">
        <li class="layui-nav-item" lay-unselect><a ew-event="flexible" lay-tips="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a></li>
        <li class="layui-nav-item" lay-unselect><a ew-event="refresh" lay-tips="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a></li>
        <li class="layui-nav-item layui-hide-sm layui-show-xs-inline-block" lay-unselect><a>更多</a><dl class="layui-nav-child" id="main-nav-more"></dl></li>
    </ul>
    <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item" lay-unselect>
            <a ew-event="message" lay-tips="消息">
                <i class="layui-icon layui-icon-notice"></i>
                <span class="layui-badge-dot"></span><!--小红点-->
            </a>
        </li>
        <li class="layui-nav-item" lay-unselect>
            <a ew-event="note" lay-tips="便签"><i class="layui-icon layui-icon-note"></i></a>
        </li>
        <li class="layui-nav-item layui-hide-xs" lay-unselect>
            <a ew-event="fullScreen" lay-tips="全屏"><i class="layui-icon layui-icon-screen-full"></i></a>
        </li>
        <li class="layui-nav-item layui-hide-xs" lay-unselect>
            <a ew-event="lockScreen" lay-tips="锁屏"><i class="layui-icon layui-icon-password"></i></a>
        </li>
        <li class="layui-nav-item" lay-unselect>
            <a>
                <img src="/scripts/libs/images/head.png" class="layui-nav-img">
                <cite>@Model.real_name</cite>
            </a>
            <dl class="layui-nav-child">
                <dd lay-unselect>
                    <a href="/index.html" target="_blank">网站前台</a>
                </dd>
                <dd lay-unselect>
                    <a ew-href="page/template/user-info.html">个人中心</a>
                </dd>
                <dd lay-unselect>
                    <a ew-href="/admin/manager/manager_pwd">修改密码</a>
                </dd>
                <hr>
                <dd lay-unselect>
                    <a ew-event="logout" data-url="/admin/home/logOff">注销</a>
                </dd>
            </dl>
        </li>
        <li class="layui-nav-item" lay-unselect>
            <a ew-event="theme" lay-tips="主题"><i class="layui-icon layui-icon-more-vertical"></i></a>
        </li>
    </ul>
</div>
<!-- 侧边栏 -->
<div class="layui-side">
    <div class="layui-side-scroll arrow3" id="sidebar-nav"></div>
</div>
<!--全局菜单-->
<a class="btn-paograms btn-pop" href="javascript:;"><i class="iconfont icon-list-fill"></i></a>
<div id="pop-menu" class="pop-menu">
    <div class="pop-box">
        <h1 class="lay-tips"><i class="iconfont icon-setting"></i>导航菜单</h1>
        <i class="close iconfont icon-remove btn-pop"></i>
        <div class="list-box"></div>
    </div>
</div>
<!--/全局菜单-->
@section Scripts{
    <script type="text/javascript">
        layui.use(['index', 'element', 'cmswh', 'notice', 'admin'], function () {
            var index = layui.index, element = layui.element, notice = layui.notice, cmswh = layui.cmswh, admin = layui.admin;
            notice.msg('正在加载目录...', { icon: 4, close: true });
            // 默认加载主页
            index.loadHome({
                menuPath: '/admin/center/index',
                menuName: '首页',
                loadSetting: true,
                onlyLast:true
            });
            // ajax渲染侧边栏
            $.get('/admin_ajax/get_navigation_list', function (res) {
                if (res.status == 0) {
                    return notice.error({ message: res.msg, timeout: false, position: 'topCenter' });
                }
                $("#sidebar-nav").html(res.msg);
                $("#pop-menu .list-box").html(res.pop);
                cmswh.initMenuTree();
                cmswh.initPopMenuTree();
                element.render('nav');
                notice.destroy();
            }, 'json');
            $(".btn-pop").on("click", function () {
                cmswh.togglePopMenu();
            });
        });
    </script>
}
